#ifndef __INC_EXT_SBERROR_H__
#define __INC_EXT_SBERROR_H__

#if _MSC_VER
#pragma once
#endif

K_EXTERN_C_BEGIN

//////////////////////////////////////////////////////////////////////////
// error
#define KERR_SUCCESS					0		// no error
#define KERR_UNKNOWN					1		// unknow error
#define KERR_FAIL						2		// operation fail
#define KERR_INTERNAL					3		// internal error
#define KERR_EXCEPTION					4		// exception
#define KERR_NEEDINIT					5		// not initialized
#define KERR_ALREADY					6		// already initialized
#define KERR_NOTABLE					7		// not a table
#define KERR_ARGUMENT					8		// invalid argument
#define KERR_NULL						9		// value is null
#define KERR_LAST						10		// value is last
#define KERR_INVAL						11		// invalid value
#define KERR_EMPTY						12		// value is empty
#define KERR_NOMEM						13		// no memory
#define KERR_NOSUPP						14		// not support function
#define KERR_SYNTAX						15		// syntax error
#define KERR_NOFILE						16		// file not found, no file
#define KERR_NODIR						17		// directory not found, no directory
#define KERR_FAIL_READ					18		// fail to read
#define KERR_FAIL_WRITE					19		// fail to write
#define KERR_FAIL_OPEN					20		// fail to open
#define KERR_FAIL_CREATE				21		// fail to create
#define KERR_OVERFLOW					22		// overflow
#define KERR_UNDERFFLOW					23		// underflow
#define KERR_EXIST						24		// already existance
#define KERR_NOEXIST					25		// not existance
#define KERR_CAST						26		// invalid cast
#define KERR_NOMEAN						27		// no mean
#define KERR_NOTIMPL					28		// not implemented yet
#define KERR_NOTARGET					29		// invalid target, no target
#define KERR_STACKOVERFLOW				30		// stack overflow
#define KERR_NONATIVE					31		// not native element
#define KERR_NOFUNCTION					32		// no function found
#define KERR_NOOPS						33		// no operator found
#define KERR_NOMNS						34		// invalid mnemonic
#define KERR_NOTYPE						35		// invalid type
#define KERR_READONLY					36		// read only, do not write
#define KERR_WRITEONLY					37		// write only, do not read
#define KERR_READDENY					38		// read deny
#define KERR_WRITEDENY					39		// write deny
#define KERR_TYPEMISS					40		// type mismatch
#define KERR_PROPERTY					41		// property
#define KERR_PARSE						42		// parse error
#define KERR_NOREF						43		// no reference found
#define KERR_UNEXPECTEXCEPTION			44		// unexpected exception
#define KERR_NOLOCK						45		// cannot lock
#define KERR_DRIVER						46		// invalid driver
#define KERR_DEVICE						47		// invalid device
#define KERR_CONTEXT					48		// invalid context
#define KERR_MAPPING					49		// invalid mapping
#define KERR_NOMULTI					50		// multi-instance not support
#define KERR_CLEAN						51		// problem(s) in clean up
#define KERR_RANGE						52		// invalid range
#define KERR_STRIDE						53		// invalid stride value

KAPI const char* k_errmsg(kint n);

K_EXTERN_C_END

#endif	// __INC_EXT_SBERROR_H__
